@php
  $active = empty($active)?'dashboard':$active;
  $r = explode('.', $active);
  $parent = $r[0];
  $item = count($r) > 1?$r[1]:'';
@endphp

@if (request()->admin_user->admin_type == App\Models\AdminUser::SUPER_ADMIN)
<section class="sidebar">
  <ul class="sidebar-menu tree" data-widget="tree">
    <li class="treeview {{ $parent == 'admin_users'?'active':'' }}">
      <a href="#"><i class="fa fa-group"></i><span>管理员管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'admin_users'? '':'display:none' }}">
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/users"><i class="fa fa-circle-o"></i>管理员信息</a></li>
        <li class="{{ $item == 'create'?'active':'' }}"><a href="/admin/users/create"><i class="fa fa-circle-o"></i>新建管理员</a></li>
        <li class="{{ $item == 'create_luo_admin'?'active':'' }}"><a href="/admin/users/create_luo_admin"><i class="fa fa-circle-o"></i>新建部落管理员</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'ants'?'active':'' }}">
      <a href="#"><i class="fa fa-user"></i><span>用户管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'ants'? '':'display:none' }}">
        <li class="{{ $item == 'index_0'?'active':'' }}"><a href="/admin/ants?status=0"><i class="fa fa-circle-o"></i>待审核用户列表</a></li>
        <li class="{{ $item == 'index_-1'?'active':'' }}"><a href="/admin/ants"><i class="fa fa-circle-o"></i>用户列表</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'luo'?'active':'' }}">
      <a href="#"><i class="fa fa-support"></i><span>部落管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'luo'? '':'display:none' }}">
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/luo"><i class="fa fa-circle-o"></i>部落列表</a></li>
        <li class="{{ $item == 'add'?'active':'' }}"><a href="/admin/luo/create"><i class="fa fa-circle-o"></i>新建部落</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'posts'?'active':'' }}">
      <a href="#"><i class="fa fa-paper-plane"></i><span>文章管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'posts'? '':'display:none' }}">
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/posts"><i class="fa fa-circle-o"></i>文章列表</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'comments'?'active':'' }}">
      <a href="#"><i class="fa fa-comments"></i><span>评论管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'comments'? '':'display:none' }}">
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/comments"><i class="fa fa-circle-o"></i>评论列表</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'profile'?'active':'' }}">
      <a href="#"><i class="fa fa-vcard"></i><span>账号信息</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'profile'? '':'display:none' }}">
        <li class="{{ $item == 'edit'?'active':'' }}"><a href="/admin/profile/edit"><i class="fa fa-circle-o"></i>修改个人信息</a></li>
        <li class="{{ $item == 'password'?'active':'' }}"><a href="/admin/profile/password"><i class="fa fa-circle-o"></i>修改密码</a></li>
      </ul>
    </li>
  </ul>
</section>
@else
<section class="sidebar">
  <ul class="sidebar-menu tree" data-widget="tree">
    <li class="treeview {{ $parent == 'posts'?'active':'' }}">
      <a href="#"><i class="fa fa-paper-plane"></i><span>文章管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'posts'? '':'display:none' }}">
        <li class="{{ $item == 'review'?'active':'' }}"><a href="/admin/posts/review"><i class="fa fa-circle-o"></i>待审核文章列表</a></li>
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/posts"><i class="fa fa-circle-o"></i>文章列表</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'comments'?'active':'' }}">
      <a href="#"><i class="fa fa-comments"></i><span>评论管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'comments'? '':'display:none' }}">
        <li class="{{ $item == 'index'?'active':'' }}"><a href="/admin/comments"><i class="fa fa-circle-o"></i>评论列表</a></li>
      </ul>
    </li>
    <li class="treeview {{ $parent == 'profile'?'active':'' }}">
      <a href="#"><i class="fa fa-vcard"></i><span>账号信息</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
      <ul class="treeview-menu" style="{{ $parent == 'profile'? '':'display:none' }}">
        <li class="{{ $item == 'edit'?'active':'' }}"><a href="/admin/profile/edit"><i class="fa fa-circle-o"></i>修改个人信息</a></li>
        <li class="{{ $item == 'password'?'active':'' }}"><a href="/admin/profile/password"><i class="fa fa-circle-o"></i>修改密码</a></li>
      </ul>
    </li>
  </ul>
</section>
@endif
